//
//  CommonHelper.h
//
//
//  Created by mac on 14/12/16.
//  Copyright (c) 2014年 CnbizMedia. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
//#import "Reachability.h"

//#import "JSON.h"

@interface CommonHelper : NSObject {
    
}
///getNavigationImageObj
+(NSArray*)getNavigationImageObj:(id)obj;
///NavigationBar底部的黑线
+(void)NavigationBarHiddenLine:(id)obj;
#pragma mark - 数据大小不同单位间转换
//将字节转化成M单位，不附带M
+(float)transformToM:(NSString *)size;
//将不M的字符串转化成字节
+ (float) transformToBytes:(NSString *)size;
//将文件大小转化成M单位或者B单位
+ (NSString *) getFileSizeString:(NSString *)size;
//经文件大小转化成不带单位ied数字
+ (float) getFileSizeNumber:(NSString *)size;
#pragma mark - 图像处理
//等比例缩放
+ (UIImage *)scaleImage:(UIImage *)image proportion:(float)scale;
+ (UIImage *)createImageWithColor:(UIColor *)color;
+ (UIImage *)reSizeImage:(UIImage *)image toSize:(CGSize)reSize;
#pragma mark - 字符串处理
//转码
+(NSString *)stringFormatTranscoding:(NSData *)strData encoding:(NSStringEncoding)encoding;
//格式化字符串，删除回车、换行符等
+ (NSString *) stringFormatSymbol:(NSData *)strData;
//计算字符串中包含字符个数(全角输入算2个，半角输入算1个)
+ (int) stringCount:(NSString *) str;
//截取字符串
+ (NSString *) cutString:(NSString *)string count:(int)_count;
//HTML符号替换
+(NSString *)stringFomartHTMLSymbol:(NSString *)html;
//解析url参数类型数据
+ (NSDictionary *)parametersWithSeparator:(NSString *)separator delimiter:(NSString *)delimiter url:(NSString *)str;

#pragma mark - 获取时间
//根据时间格式获取当前时间
+ (NSString *) stringFromTime:(NSString *)strDateFormat;

#pragma mark - 计算控件高度
///返回缓存根目录地址
+ (NSString *) getCachePath;
#pragma mark - 加密解密
//加密
+ (NSString *)encryptWithText:(NSString *)sText key:(NSString *)key;
//解密
+ (NSString *)decryptWithText:(NSString *)sText key:(NSString *)key;
#pragma mark - 16进制转换
// 十六进制转换为普通字符串的。
+ (NSData *)stringFromHexString:(NSString *)hexString;
//字符串转16进制
+ (NSString *)hexStringFromString:(NSData *)data;

#pragma mark - MD5加密
//data的MD5加密
+ (NSString *)md5ForData:(NSData*)data;
//NSString的MD5加密
+ (NSString *)md5ForString:(NSString*)str;

#pragma mark - 正则表达式验证
//验证联通、移动、电信手机号码
+(BOOL)isValidatePhone:(NSString *)Phone;
//验证电子邮箱
+(BOOL)isValidateEmail:(NSString *)email;
@end
